﻿<%@ Page Language="C#" MasterPageFile="../Shared/Website.Master" Inherits="System.Web.Mvc.ViewPage<ConsultViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div id="left">
        <div class="m">
            <h2>
                <strong>商品信息</strong>
            </h2>
            <div class="c">
                <ul>
                    <li class="ip"><a href="<%=Url.Action("PreView", "Product", new { ProductId = Model.Product.ProductId }) %>">
                        <img alt="" onerror="this.src='<%=Url.Content("~/WebResources/Images/None_150.gif") %>'"
                            src="<%=Url.Content(string.Format("~/{2}/{0}/s_{1}", Model.Product.ProductId, Model.Product.ImageName, Model.ImageRoot)) %>" /></a>
                    </li>
                    <li>商品名称：<%=Html.ActionLink(Model.Product.SubName, "PreView", "Product", new { ProductId = Model.Product.ProductId }, null) %></li>
                    <li>零售价格：<del class="fontBold colorBlue"><%=Model.Product.Price%></del></li>
                    <li>优惠价格：<strong class="colorOrange"><%=(Model.Product.Price * (decimal)Model.Product.DisCount).ToString("0.00")%></strong></li>
                    <li>评论得分：<img src="<%=Url.Content(string.Format("~/WebResources/Images/Gv{0}.jpg", (int)Model.Product.GradeValue)) %>"
                        alt="" />
                        (<%=Model.Product.GradeValue %>
                        分)</li>
                    <li>咨询数量：<%=Model.ConsultList.Count %>
                        条</li>
                    <li class="ic"><a href="javascript:void(0)" onclick="AddToCar(<%=Model.Product.ProductId %>)">
                        <img src="<%=Url.Content("~/WebResources/Images/AppendToCart.jpg") %>" alt="" /></a></li>
                </ul>
            </div>
        </div>
    </div>
    <div id="right">
        <div id="divConsult">
            <div id="consult_search">
                <input type="text" id="txtConsultKey" />
                <input type="button" id="btnConsult" value="" />
                <strong>在发表新咨询前请先搜索下，也许能找到你想要的答案，方便又快捷。</strong>
                <br />
                温馨提示：因厂家更改产品包装、产地或者更换随机附件等没有任何提前通知，且每位咨询者购买情况、提问时间等不同，为此以下回复仅对提问者3天内有效，其他网友仅供参考！若由此给您带来不便请多多谅解，谢谢！
            </div>
            <div id="div_consult_list">
                <% Html.RenderPartial("List", Model); %>
                <div class="pager divPager2">
                    <%=Html.Pager(Model.Pager) %>
                </div>
            </div>
        </div>
        <div id="divAppend">
            <div class="t">
                发表咨询：
                <%=Model.Product.SubName%><a id="acform" name="acform"></a>
            </div>
            <div class="l">
                <% using (Html.BeginForm("ConsultEdit", "Consult", FormMethod.Post)) { %>
                <%=Html.HiddenFor(p => p.Product.ProductId) %>
                <%=Html.HiddenFor(c => c.Consult.ConsultId)%>
                <dl>
                    <dt>声明：您可在购买前对产品包装、颜色、运输、库存等方面进行咨询，我们有专人进行回复！因厂家随时会更改一些产品的包装、颜色、产地等参数，所以该回复仅在当时对提问者有效，其他网友仅供参考！</dt>
                    <dd>
                        <strong>咨询内容：</strong><br />
                        <%=Html.TextAreaFor(c => c.Consult.Content)%>
                    </dd>
                    <dd>
                        <input type="submit" value="提交" />
                    </dd>
                </dl>
                <% } %>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="head" runat="server">
    <%=Html.HtmlTitle(Model.Product.SubName, Model.Product.KeyWords, Model.Product.Description)%>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cssLink" runat="server">
    <link rel="Stylesheet" type="text/css" href="<%=Url.Content("~/Css/Website/Consult.css") %>" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="jsLink" runat="server">
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/Common/Common.js")%>"></script>
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/Website/Consult.js")%>"></script>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="cssContent" runat="server">
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="jsContent" runat="server">
    <script type="text/javascript">
        window.consult_login_url = '<%=Url.Action("Login", "Home") %>';
        window.consult_search_url = '<%=Url.Action("AjaxSearch", "Consult") %>';
        window.consult_this_url = '<%=Url.Action("ConsultList", "Consult", new { productId = Model.Product.ProductId }) %>';
        window.consult_car_url = '<%=Url.Action("AddToCar", "ShopCar") %>';
        window.consult_uid = '<%=Model.Consult == null ? 0 : Model.Consult.Uid %>';
        window.consult_cid = '<%=Model.Consult == null ? 0 : Model.Consult.ConsultId %>';
        window.consult_pid = '<%=Model.Product.ProductId %>'; 
    </script>
</asp:Content>
